from flask import Flask
from flask import request

app = Flask(__name__)

@app.route('/', methods = ['GET', 'POST'])
def home():
	return '<h3>welcome</h3>'

@app.route('/login', methods=['GET'])
def login_form():
  return '''<form action="/login" method="post">
              <p><input name="username"></p>
              <p><input name="password" type="password"></p>
              <p><button type="submit">Sign In</button></p>
              </form>'''
@app.route('/login', methods = ['POST'])
def login():
	if request.form['username']  == 'admin' and request.form['password'] == 'password':
		return '<h1>hello %s<h1>' % request.form['username']
	return '''<h2>Do\'t exit user %s or password erro!!!</h2>  
		   <p><b>Plase try again!!!</b></p>''' % request.form["username"] 
		   
if __name__ == '__main__':
	app.run()